<script setup>
import { ref, onMounted } from "vue";
import { useRoute } from "vue-router";

const route = useRoute();

// 游戏信息映射
const gameInfo = {
  'honor_of_kings': {
    title: "王者荣耀",
    icon: "⚔️",
    description: "英雄模型、技能特效、地图资源",
    fullDescription: "腾讯旗下最受欢迎的MOBA手游，拥有丰富的英雄角色和精美的游戏画面。我们正在为王者荣耀准备专属的3D模型资源，包括英雄模型、技能特效、地图资源等，敬请期待！"
  },
  'pubg_mobile': {
    title: "和平精英",
    icon: "🎯",
    description: "角色模型、武器、载具资源",
    fullDescription: "光子工作室开发的战术竞技手游，以真实的射击体验和丰富的战术玩法著称。我们正在为和平精英准备专属的3D模型资源，包括角色模型、武器、载具等，敬请期待！"
  },
  'genshin_impact': {
    title: "原神",
    icon: "🌟",
    description: "角色模型、武器、场景资源",
    fullDescription: "米哈游开发的开放世界冒险RPG，拥有精美的画面和丰富的角色设定。我们正在为原神准备专属的3D模型资源，包括角色模型、武器、场景等，敬请期待！"
  },
  'league_of_legends': {
    title: "英雄联盟",
    icon: "🏆",
    description: "英雄模型、皮肤、地图资源",
    fullDescription: "拳头游戏开发的经典MOBA游戏，拥有庞大的英雄池和丰富的游戏内容。我们正在为英雄联盟准备专属的3D模型资源，包括英雄模型、皮肤、地图等，敬请期待！"
  },
  'valorant': {
    title: "无畏契约",
    icon: "🔫",
    description: "特工模型、武器、地图资源",
    fullDescription: "拳头游戏开发的战术射击游戏，结合了精确射击和独特技能系统。我们正在为无畏契约准备专属的3D模型资源，包括特工模型、武器、地图等，敬请期待！"
  },
  'overwatch': {
    title: "守望先锋",
    icon: "🛡️",
    description: "英雄模型、武器、地图资源",
    fullDescription: "暴雪娱乐开发的团队射击游戏，拥有独特的英雄角色和团队合作玩法。我们正在为守望先锋准备专属的3D模型资源，包括英雄模型、武器、地图等，敬请期待！"
  },
  'apex_legends': {
    title: "Apex英雄",
    icon: "🚀",
    description: "传奇模型、武器、地图资源",
    fullDescription: "Respawn Entertainment开发的大逃杀射击游戏，拥有独特的英雄技能系统。我们正在为Apex英雄准备专属的3D模型资源，包括传奇模型、武器、地图等，敬请期待！"
  },
  'fortnite': {
    title: "堡垒之夜",
    icon: "🏗️",
    description: "角色模型、武器、建筑资源",
    fullDescription: "Epic Games开发的大逃杀游戏，结合了射击和建造元素。我们正在为堡垒之夜准备专属的3D模型资源，包括角色模型、武器、建筑等，敬请期待！"
  }
};

const currentGame = ref(null);
const progress = ref(0);

onMounted(() => {
  const gameId = route.name;
  currentGame.value = gameInfo[gameId] || {
    title: "未知游戏",
    icon: "🎮",
    description: "3D资源",
    fullDescription: "我们正在为这款游戏准备专属的3D模型资源，敬请期待！"
  };
  
  document.title = `3D资源分享站 - ${currentGame.value.title}资源中心`;
  
  // 模拟进度条动画
  const interval = setInterval(() => {
    if (progress.value < 85) {
      progress.value += Math.random() * 5;
    } else {
      clearInterval(interval);
    }
  }, 100);
});
</script>

<template>
  <div class="coming-soon-container">
    <div class="content-wrapper">
      <!-- 面包屑导航 -->
      <div class="breadcrumb">
        <span class="breadcrumb-item" @click="$router.push('/index')">首页</span>
        <span class="breadcrumb-separator">/</span>
        <span class="breadcrumb-item active">{{ currentGame?.title }}</span>
      </div>

      <!-- 游戏信息 -->
      <div class="game-header">
        <div class="game-icon">{{ currentGame?.icon }}</div>
        <div class="game-info">
          <h1 class="game-title">{{ currentGame?.title }}</h1>
          <p class="game-subtitle">{{ currentGame?.description }}</p>
        </div>
      </div>

      <!-- 主要内容 -->
      <div class="main-content">
        <div class="coming-soon-card">
          <div class="card-header">
            <div class="status-icon">🚧</div>
            <h2 class="status-title">正在开发中</h2>
          </div>
          
          <div class="card-body">
            <p class="description">{{ currentGame?.fullDescription }}</p>
            
            <!-- 进度条 -->
            <div class="progress-section">
              <div class="progress-info">
                <span class="progress-label">开发进度</span>
                <span class="progress-percentage">{{ Math.round(progress) }}%</span>
              </div>
              <div class="progress-bar">
                <div class="progress-fill" :style="{ width: progress + '%' }"></div>
              </div>
            </div>
            
            <!-- 功能预告 -->
            <div class="features-preview">
              <h3 class="features-title">即将推出的功能</h3>
              <div class="features-grid">
                <div class="feature-item">
                  <span class="feature-icon">🎮</span>
                  <span class="feature-text">角色3D模型</span>
                </div>
                <div class="feature-item">
                  <span class="feature-icon">⚔️</span>
                  <span class="feature-text">武器模型</span>
                </div>
                <div class="feature-item">
                  <span class="feature-icon">🏰</span>
                  <span class="feature-text">场景模型</span>
                </div>
                <div class="feature-item">
                  <span class="feature-icon">✨</span>
                  <span class="feature-text">特效资源</span>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 返回按钮 -->
      <div class="action-buttons">
        <button class="back-btn" @click="$router.push('/index')">
          <span class="btn-icon">🏠</span>
          <span class="btn-text">返回首页</span>
        </button>
      </div>
    </div>

    <!-- 背景动画 -->
    <div class="background-animation">
      <div class="floating-shapes">
        <div class="shape shape-1"></div>
        <div class="shape shape-2"></div>
        <div class="shape shape-3"></div>
        <div class="shape shape-4"></div>
      </div>
    </div>
  </div>
</template>

<style scoped>
.coming-soon-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.content-wrapper {
  position: relative;
  z-index: 2;
  max-width: 800px;
  width: 100%;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  font-size: 14px;
  color: var(--accent-silver);
}

.breadcrumb-item {
  cursor: pointer;
  transition: color 0.3s ease;
}

.breadcrumb-item:hover {
  color: var(--accent-gold);
}

.breadcrumb-item.active {
  color: var(--accent-gold);
  cursor: default;
}

.breadcrumb-separator {
  color: var(--accent-silver);
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease-out;
}

.game-icon {
  font-size: 64px;
  animation: pulse 2s ease-in-out infinite;
}

.game-info {
  text-align: left;
}

.game-title {
  font-size: 36px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-gold), var(--white));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 10px 0;
}

.game-subtitle {
  font-size: 18px;
  color: var(--accent-silver);
  margin: 0;
  font-weight: 300;
}

.main-content {
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.coming-soon-card {
  background: var(--gradient-card);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 30px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.status-icon {
  font-size: 32px;
  animation: pulse 2s ease-in-out infinite;
}

.status-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-gold);
  margin: 0;
}

.card-body {
  padding: 40px;
}

.description {
  font-size: 16px;
  color: var(--accent-silver);
  text-align: center;
  line-height: 1.6;
  margin: 0 0 30px 0;
}

.progress-section {
  margin-bottom: 40px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-label {
  font-size: 14px;
  color: var(--accent-silver);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-percentage {
  font-size: 16px;
  color: var(--accent-gold);
  font-weight: 700;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(212, 175, 55, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), #b8941f);
  border-radius: 4px;
  transition: width 0.3s ease;
  animation: glow 2s ease-in-out infinite;
}

.features-preview {
  text-align: center;
}

.features-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  margin: 0 0 20px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background: rgba(212, 175, 55, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 15px;
  transition: all 0.3s ease;
}

.feature-item:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--accent-gold);
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 24px;
}

.feature-text {
  font-size: 14px;
  color: var(--accent-silver);
  font-weight: 600;
  text-align: center;
}

.action-buttons {
  display: flex;
  justify-content: center;
  margin-top: 40px;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  background: linear-gradient(135deg, var(--accent-gold), #b8941f);
  border: none;
  border-radius: 25px;
  color: var(--primary-black);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

.btn-icon {
  font-size: 18px;
}

/* 背景动画 */
.background-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.floating-shapes {
  position: relative;
  width: 100%;
  height: 100%;
}

.shape {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
  animation: float 6s ease-in-out infinite;
}

.shape-1 {
  width: 100px;
  height: 100px;
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.shape-2 {
  width: 80px;
  height: 80px;
  top: 20%;
  right: 15%;
  animation-delay: 2s;
}

.shape-3 {
  width: 120px;
  height: 120px;
  bottom: 20%;
  left: 20%;
  animation-delay: 4s;
}

.shape-4 {
  width: 60px;
  height: 60px;
  bottom: 10%;
  right: 10%;
  animation-delay: 1s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .game-header {
    flex-direction: column;
    text-align: center;
  }
  
  .game-info {
    text-align: center;
  }
  
  .game-title {
    font-size: 28px;
  }
  
  .game-subtitle {
    font-size: 16px;
  }
  
  .card-body {
    padding: 30px 20px;
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .feature-item {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .coming-soon-container {
    padding: 15px;
  }
  
  .game-icon {
    font-size: 48px;
  }
  
  .game-title {
    font-size: 24px;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .card-header {
    padding: 20px;
  }
  
  .status-title {
    font-size: 20px;
  }
}
</style>
